<?php

$i=1;
echo'<ul  id="menuvertical">';
foreach($mainCategories as $mainCat)
{
	if($mainCat->getIdCat())
	{
		if($i!=1)
			echo "<br /><br />";
			
		echo "<li><a href='?page=list_articles.php&categ=".$mainCat->getIdCat()."'>".$mainCat->getNameCat()."</a></li><br />";

		$mainCategories2 = Category::listing("WHERE CAT_IdParent=".$mainCat->getIdCat()." ORDER BY CAT_Libelle");
		echo'<ul id="ssmenuvertical">';
		if(count($mainCategories2)>0)
		{
			foreach($mainCategories2 as $mainCat2)
			{
				echo "<li><a  href='?page=list_articles.php&categ=".$mainCat2->getIdCat()."'>".$mainCat2->getNameCat()."</a></li><br />";						
			}
		}
		echo'</ul>';
	}
	$i++;
}			
echo'</ul>';
?>